home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 12 / CU Amiga Magazine's Super CD-ROM 12 (1997)(EMAP Images)(GB)[!][issue 1997-07].iso / CUCD / Utilities / AmiBroker / Install-AmiBroker < prev    next >
Text File  |  1997-04-02  |  10KB  |  378 lines

  1. ; Installer Script for AmiBroker 2.00
  2. ; Revision 5C
  3. ; March 28th, 1997  Tomasz Janeczko, TJ Productions.
  4. ; $VER: Install-AmiBroker 5 (28 Mar 1997)
  5. ;
  6.  
  7. ; ********* English strings (default)
  8.  
  9. (set #badkick "I'm sorry, but AmiBroker requires OS 2.04 or better")
  10. (set #welcome (cat "\nAmiBroker 2.00\nHard Disk Install Script Rev 5.\n"
  11.                    "Copyright (C)1995-97 by Tomasz Janeczko\n\n"
  12.                    "This is SHAREWARE product, so if you use it you should register\n\n\n"
  13.                    "ReqTools (C)1991-95 Nico François\n"
  14.                    "SAS/C (C)1988-93 SAS Institute Inc.\n"
  15.                    "Installer (C)1991-93 Commodore-Amiga, Inc.") )
  16.  
  17. (set #destination "Where do you want to install AmiBroker? ( 'AmiBroker' drawer will be created there )" )
  18. (set #programver  "Which version of AmiBroker do you want to install" )
  19. (set #progverhelp (cat "\nAmiBroker - this version is for 68000+ processors and will work on all Amigas.\n\n"
  20.                        "AmiBroker.FPU - this version is for 68020+ and 68882 floating point coprocessor "
  21.                        "or 68040/060. Will work only on accelerated Amigas" ))
  22.  
  23. (set #olddataexist (cat "You have stock database already installed in your 'data' directory\n"
  24.                         "Please select desired action:" ))
  25.  
  26. (set #dataexisthelp (cat "\nOption:'replace old data' will erase all existing stock data and replace them with a new database"
  27.                          "\n\nOption: 'backup old data and install new' will move your old data to separate directory. Then, new data will be installed."
  28.                          "\n\nOption 'leave untouched' won't change anything in your database (no new data will be installed)" ))
  29.  
  30. (set #replace "replace old data")
  31. (set #backup "backup old data and install new")
  32. (set #leave "leave untouched")
  33.  
  34. (set #backupinprogress (cat "Creating backup of your stock database...\n\n"
  35.                             "You'll find it in directory:\n" ))
  36.  
  37. (set #unpacking    "Unpacking AmiBroker program to:\n")
  38. (set #unpackingFPU "Unpacking AmiBroker.FPU program to:\n")
  39. (set #dearchiving  "Dearchiving database and installing files to:\n")
  40. (set #limiting     (cat "Because your Amiga is equiped with small amount of memory (less than 2MB) "
  41.                         "I have to limit the number of quotation in database to 160"))
  42.  
  43.  
  44. ; ********* Polish strings
  45.  
  46. (if (= @language "polski") (
  47.  
  48. (set #badkick "Bardzo mi przykro ale program AmiBroker wymaga systemu w wersji 2.04 lub wyûszej")
  49. (set #welcome (cat "\nAmiBroker 2.00\nSkrypt instalacyjny HD (Rev 5)\n"
  50.                    "Copyright (C)1995-97 by Tomasz Janeczko\n\n"
  51.                    "Program ten to SHAREWARE, chcâc wiëc go uûywaê powinieneô zarejestrowaê sië jako legalny uûytkownik\n\n\n"
  52.                    "ReqTools (C)1991-95 Nico François\n"
  53.                    "SAS/C (C)1988-93 SAS Institute Inc.\n"
  54.                    "Installer (C)1991-93 Commodore-Amiga, Inc.") )
  55.  
  56. (set #destination "Wskaû dysk lub katalog gdzie chcesz umieôciê AmiBrokera? ( Zostanie tam utworzony katalog 'AmiBroker')" )
  57. (set #programver  "Wybierz jakâ wersjë AmiBrokera chcesz zainstalowaê" )
  58. (set #progverhelp (cat "\nAmiBroker - to wersja na zwykîy procesor 68000.\n\n"
  59.                        "AmiBroker.FPU - to wersja na 68020 z koprocesorem 68882 "
  60.                        "lub teû procesory 68040 i 68060" ))
  61.  
  62. (set #olddataexist (cat "Masz juû zainstalowane dane o spóîkach i notowaniach w katalogu 'data'\n"
  63.                         "Zdecyduj co mam z nimi zrobiê:" ))
  64.  
  65. (set #dataexisthelp (cat "\nOpcja 'zastâp stare notowania nowymi' skasuje dotychczasowe dane i zainstaluje nowe w dotychczasowym podkatalogu 'data'"
  66.                          "\n\nOpcja 'utwórz kopië starych i zainstaluj nowe' przeniesie stare notowania do katalogu 'data_old', a nowe dane zapisze w katalogu 'data'"
  67.                          "\n\nOpcje 'pozostaw stare notowania' nie zainstaluje ûadnych nowych danych, pozostawiajâc tym samym stare dane bez zmian" ))
  68.  
  69. (set #replace "zastâp stare notowania nowymi")
  70. (set #backup "utwórz kopië starych i zainstaluj nowe")
  71. (set #leave "pozostaw stare notowania")
  72.  
  73. (set #backupinprogress (cat "Tworzë kopie starych notowaï...\n\n"
  74.                             "Znajdziesz je w katalogu:\n" ))
  75.  
  76. (set #unpacking    "Rozpakowujë program AmiBroker do katalogu:\n")
  77. (set #unpackingFPU "Rozpakowujë program AmiBroker.FPU do katalogu:\n")
  78. (set #dearchiving  "Rozpakowujë archiwum i instalujë nowe notowania do katalogu:\n")
  79. (set #limiting     (cat "Poniewaû Twoja Amiga jest wyposaûona w niewielkâ iloôê pamiëci (mniej niû 2MB) "
  80.                         "muszë ograniczyê iloôê notowaï w bazie danych do 160"))
  81.  
  82. ))
  83.  
  84. ; ******* main install part
  85.  
  86. ; set up an error cleanup routine
  87. (onerror
  88.         (makeassign "AmiBrokerinstpgm" (safe))
  89. )
  90.  
  91. ; check OS version
  92.  
  93. (if (< (/ (getversion) 65536) 37)
  94.     (
  95.         (message #badkick)
  96.         (exit (quiet))
  97.     )
  98. )
  99.  
  100. ;just started
  101. (complete 0)
  102.  
  103. (message #welcome)
  104.  
  105. (welcome)
  106.  
  107. ;cancel the assign in case of installation restart
  108. (makeassign "AmiBrokerinstpgm" (safe))
  109.  
  110.  
  111. ; get the dest dir for AmiBroker
  112. (set AmiBroker_dest
  113.         (tackon
  114.                 (askdir
  115.                         (prompt #destination)
  116.                         (help @askdir-help)
  117.                         (default @default-dest)
  118.                 )
  119.                 "AmiBroker"
  120.         )
  121. )
  122.  
  123.  
  124. (complete 10)
  125.  
  126.  
  127. ;We now have a valid destination, so tell Installer where AmiBroker will end up
  128. ;so the exit page will be correct.
  129. (set @default-dest AmiBroker_dest)
  130.  
  131. ;
  132. ; Ask which files one wants to have installed
  133. ;
  134. ;
  135.  
  136. (set progver 1)
  137.  
  138. (if (OR (exists "AmiBroker.FPU") (exists "AmiBroker.FPU.lha") )
  139.    (set progver (askoptions
  140.                  (prompt #programver )
  141.                  (help  #progverhelp )
  142.                   (choices
  143.                     "AmiBroker"
  144.                     "AmiBroker.FPU"
  145.                   )
  146.                  (default 3)
  147.                 )
  148.    )
  149. )
  150.  
  151. ;copy program files from source to dest
  152.  
  153. (if (IN progver 0)
  154.  (if (exists "AmiBroker")
  155.    (copyfiles
  156.      (source "AmiBroker")
  157.      (dest AmiBroker_dest)
  158.      (infos)
  159.    )
  160.    (;else
  161.      (working #unpacking AmiBroker_dest )
  162.      (run (cat "lha -qf x AmiBroker.lha \"" (tackon AmiBroker_dest "\"" ) ) )
  163.    )
  164.  )
  165. )
  166.  
  167. (complete 10)
  168.  
  169. (if (IN progver 1)
  170.  (if (exists "AmiBroker.FPU")
  171.    (copyfiles
  172.      (source "AmiBroker.FPU")
  173.      (dest AmiBroker_dest)
  174.      (infos)
  175.    )
  176.    (;else
  177.      (working #unpackingFPU AmiBroker_dest )
  178.      (run (cat "lha -qf x AmiBroker.FPU.lha \"" (tackon AmiBroker_dest "\"" ) ) )
  179.    )
  180.  )
  181. )
  182.  
  183. (complete 20)
  184.  
  185. (copyfiles
  186.   (source "AmiBroker.guide")
  187.   (dest AmiBroker_dest)
  188.   (infos)
  189. )
  190.  
  191.  
  192. (complete 30)
  193.  
  194. (copyfiles
  195.   (source "AmiBroker.history")
  196.   (dest AmiBroker_dest)
  197.   (infos)
  198. )
  199.  
  200. (copyfiles
  201.   (source "ReadMe")
  202.   (dest AmiBroker_dest)
  203.   (infos)
  204. )
  205.  
  206. ; delete old data file if exists
  207. (if (exists (tackon AmiBroker_dest "broker.data"))
  208.     (delete (tackon AmiBroker_dest "broker.data"))
  209. )
  210.  
  211.  
  212. (if (exists (tackon AmiBroker_dest "data"))
  213.     (set datmode (askchoice
  214.                   (prompt #olddataexist)
  215.                   (help #dataexisthelp )
  216.                   (default 1)
  217.                   (choices
  218.                      #replace
  219.                      #backup
  220.                      #leave
  221.                   )
  222.                  )
  223.     )
  224. )
  225.  
  226.  
  227. (if (= datmode 1) (
  228.        (makedir (tackon AmiBroker_dest "data_old") )
  229.        (working #backupinprogress (tackon AmiBroker_dest "data_old"))
  230.        (copyfiles
  231.                (source (tackon AmiBroker_dest "data") )
  232.                (dest   (tackon AmiBroker_dest "data_old") )
  233.                (all)
  234.                (nogauge)
  235.        )
  236. ))
  237.  
  238. (complete 40)
  239.  
  240. (makedir (tackon AmiBroker_dest "data") )
  241.  
  242. (if (< datmode 2)
  243.         (if (exists "data")
  244.             (copyfiles
  245.                  (source "data")
  246.                  (dest   (tackon AmiBroker_dest "data") )
  247.                  (all)
  248.             )
  249.             (;else
  250.                  (working #dearchiving (tackon AmiBroker_dest "data"))
  251.                  (makeassign "AmiBrokerData" (tackon AmiBroker_dest "data") (safe))
  252.                  (run "lha -qf x abdata.lha AmiBrokerData:" )
  253.                  (makeassign "AmiBrokerData" (safe))
  254.             )
  255.         )
  256.  
  257. )
  258.  
  259.  
  260. (complete 60)
  261.  
  262. (set #freemem (database "total-mem") )
  263.  
  264. (if (< (- #freemem 2000000) 0)
  265.   (
  266.      (working #limiting)
  267.      (makeassign "AmiBrokerData" (tackon AmiBroker_dest "data") (safe))
  268.      (run "ConvertData >NIL: AmiBrokerData: 160" )
  269.      (makeassign "AmiBrokerData" (safe))
  270.   )
  271. )
  272.  
  273. (working)
  274.  
  275. (if (NOT (exists (tackon AmiBroker_dest "broker.portfolio") ) )
  276.     (copyfiles
  277.      (source "broker.portfolio")
  278.      (dest AmiBroker_dest)
  279.     )
  280. )
  281.  
  282. ; copy key-file if exists
  283. (if (exists "broker.key")
  284.     (copyfiles
  285.      (source "broker.key")
  286.      (dest AmiBroker_dest)
  287.     )
  288. )
  289.  
  290. ; copy key-file if exists
  291. (if (exists "broker.arexx")
  292.     (copyfiles
  293.      (source "broker.arexx")
  294.      (dest AmiBroker_dest)
  295.     )
  296. )
  297.  
  298. (complete 70)
  299.  
  300. ; delete old BrokerSymbol font (1.22 and earlier vers) if exists
  301. (if (exists "FONTS:BrokerSym.font")
  302.     (delete "FONTS:BrokerSym.font")
  303. )
  304.  
  305. (if (exists "FONTS:BrokerSym/16")
  306.     (delete "FONTS:BrokerSym/16")
  307. )
  308.  
  309. (if (exists "FONTS:BrokerSym")
  310.     (delete "FONTS:BrokerSym")
  311. )
  312.  
  313. ; copy fonts needed
  314. (copyfiles
  315.   (source "fonts")
  316.   (dest "FONTS:")
  317.   (fonts)
  318.   (all)
  319. )
  320.  
  321.  
  322. (complete 80)
  323.  
  324. (copyfiles
  325.   (source "ARexxDemo.abrx")
  326.   (dest AmiBroker_dest)
  327.   (infos)
  328. )
  329.  
  330. (makedir (tackon AmiBroker_dest "Examples") )
  331.  
  332. (copyfiles
  333.   (source "Examples")
  334.   (dest (tackon AmiBroker_Dest "Examples" ) )
  335.   (all)
  336. )
  337.  
  338.  
  339. (makedir (tackon AmiBroker_dest "Teletext") )
  340.  
  341. (copyfiles
  342.   (source "Teletext")
  343.   (dest (tackon AmiBroker_Dest "Teletext" ) )
  344.   (all)
  345. )
  346.  
  347.  
  348. (makedir (tackon AmiBroker_dest "Rexx") )
  349.  
  350. (copyfiles
  351.   (source "Rexx")
  352.   (dest (tackon AmiBroker_Dest "Rexx" ) )
  353.   (all)
  354. )
  355.  
  356.  
  357. (copyfiles
  358.   (source "examples.info")
  359.   (dest AmiBroker_Dest)
  360. )
  361.  
  362. (complete 90)
  363.  
  364. ;un-snapshot the AmiBroker drawer icon
  365. (tooltype
  366.         (dest AmiBroker_dest)
  367.         (noposition)
  368. )
  369.  
  370. ;done with the install
  371. (complete 100)
  372.  
  373. ;cleanup
  374. (makeassign "AmiBrokerinstpgm" (safe))
  375.  
  376. ;and get out
  377. (exit)
  378.